﻿@model MiniBlog.Core.ViewModels.PostView.EditPostViewModel

@{
    ViewData["Title"] = "发博文";
    var category= ViewBag.Categories as IEnumerable<SelectListItem>;
}

<h4>Post</h4>
<div class="row">
    <div class="col-md-4">
        <form asp-action="Post">
            <div asp-validation-summary="ModelOnly" class="text-danger"></div>
            <div class="form-group" style="display:none;">
                <label asp-for="Id" class="control-label"></label>
                <input asp-for="Id" class="form-control" />
                <span asp-validation-for="Id" class="text-danger"></span>
            </div>
            <div class="form-group">
                <label asp-for="Title" class="control-label"></label>
                <input asp-for="Title" class="form-control" />
                <span asp-validation-for="Title" class="text-danger"></span>
            </div>
            <div class="form-group">
                <label asp-for="CategoryId" class="control-label"></label>
                <select asp-for="CategoryId" asp-items="category" class="form-control"></select>
                <span asp-validation-for="CategoryId" class="text-danger"></span>
            </div>
            <div class="form-group">
                <label asp-for="Icon" class="control-label"></label>
                <input asp-for="Icon" class="form-control" />
                <span asp-validation-for="Icon" class="text-danger"></span>
            </div>
            <div class="form-group form-check">
                <label class="form-check-label">
                    <input class="form-check-input" asp-for="IsShow" />
                    @Html.DisplayNameFor(model => model.IsShow)
                </label>
            </div>
            <div class="form-group">
                <input type="submit" value="提交" class="btn btn-primary" />
            </div>
        </form>
    </div>
</div>

@section Scripts {
    @{await Html.RenderPartialAsync("_ValidationScriptsPartial");}
}
